Public safety is vital to public health and happiness. Our goal was to build R shiny app to analyze various aspects of crimes in Boston, including:
Map displaying individual crimes by day
Heatmap displaying dangerous locations overall
Time series displaying trend of different crimes over time
Schools map displaying relationship between school locations and crime rate
Income map displayong relationship between income and crime rate by location
The data is from Boston Police Department hosted at data.boston.gov (https://data.boston.gov/dataset/crime-incident-reports-august-2015-to-date-source-new-system, https://data.boston.gov/dataset/crime-incident-reports-july-2012-august-2015-source-legacy-system)
In total, there are 608,471 crimes recorded in the dataset. For each crime, the date, time, location, and crime description is provided.
Here are the main areas this report addresses:
Most frequent crime types
Most frequent time periods of crime
Most frequent locations of crime
Changes in crime over time
Relationship between crime & schools
Relationship between crime & income
This data contains crime data in Boston from 2015-06-15 to 2018-11-17, a total of 340415 incidents with 17 variables. It comes from the Boston Police Department (data.boston.gov).
The most frequent crime type is Motor vehicle accident followed by larceny and medical assistant.
### Most frequent crime by UCR_PART in Boston
The Uniform Crime Reports (UCR) compiles official data on crime in the United States, published by the Federal Bureau of Investigation (FBI). In Boston, the most frequent two crime types are Part I and Part II. In Part I, the UCR indexes reported incidents of index crimes which are broken into two categories: violent and property crimes.In Part II, the following categories are tracked: simple assault, curfew offenses and loitering, embezzlement, forgery and counterfeiting, disorderly conduct, driving under the influence, drug offenses, fraud, gambling, liquor offenses, offenses against the family, prostitution, public drunkenness, runaways, sex offenses, stolen property, vandalism, vagrancy, and weapons offenses.
Below shows a distribution of crime by the hour of the day: there seems to be less crime during early morning (around 5 am), which makes sense since probably most people are asleep. As it gets to morning the crime rate goes up, and the amount of crime peaks around 4-7pm, before gradually dropping as night comes.
There are two other peaks at 12-1am and 12-1pm in the graph above, but it is likely due to data entry habits:
Above shows distribution of crime by the minute. There are two large peaks at 0 (= 12:00am) and at 720 (= 12:00pm), so possibly the police logged these two times in the database when the exact time is unclear
Below shows a boxplot that compares the number of crime per day between different days of the week. From the graph it seems like actually Sunday has the lowest number of crimes, which might be a little surprising since it is in the weekend. Friday has the highest number of crimes (although the difference is small)
The graph below shows more detailed distribution of crime across day of week & hour. The color shows the average number of crime at the specific hour and day of week (darker color is higher crime)
As we have observed before, crime is lower during early morning, but the exact period of time with lowest number of crime shifts according to the day of the week: on weekdays crime is lowest around 1-5am, while on weekends it shifts later and becomes lowest around 3-6am. You might expect since people stay up to later on the weekends.
Below shows the distribution of crime according to day of the month
1st, 15th, 31st have slightly larger number of crime, which could be due to data entry habits
Graph below shows the distribution of crime over different months of the year: crime seems to increase at the beginning of the year, peak at around July, and then decrease again (although the difference is not very large).
This might be expected since Boston is up north and can be pretty cold, so people might stay inside more during the winter, leading to reduced crime.
The graph below breaks it down by day of the year. Again you can see the crime count increasing in beginning of the year, peaking around mid-year, and then dropping again.
(The blue lines in the back show standard error)
Below shows the distribution of crime (average number of crime per day) across different years: there appears to be an increase between 2014 and 2015, but this could be due to data issues (our data comes from two sets, one 2012~2015, one 2015~2018, so it is possible that the police now records or reports more crimes in the new crime entry system they started using in 2015)